package com.lg.wxq.utils;

import java.util.ArrayList;

import android.app.Activity;

import com.lg.wxq.ui.R;

public class FaceUtils extends Activity {
	private static ArrayList<Integer> faceList;
	private static ArrayList<String> faceNameList;
	private static int[] face;
	private static String[] faceName;

	static {
		faceName = new String[] { "微笑", "郁闷", "色" };

		face = new int[] { R.drawable.face001, R.drawable.face002, R.drawable.face003 };

		faceList = new ArrayList<Integer>();
		for (int i = 0; i < face.length; i++) {
			faceList.add(face[i]);
		}

		faceNameList = new ArrayList<String>();
		for (int i = 0; i < faceName.length; i++) {
			faceNameList.add("["+faceName[i]+"]");
		}

	}

	public static ArrayList<Integer> getFaceResource() {
		return faceList;
	}

	public static ArrayList<String> getFaceNameResource() {
		return faceNameList;
	}

	public static boolean hasFace(String face) {
		return faceNameList.contains(face)?true:false;
	}

	public static String getFace(String str) {
		return hasFace(str)?("<img src='" + faceList.get(faceNameList.indexOf(str)) + "'/>"):str;
	}

}
